package com.solution.model;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.SequenceGenerator;

import static javax.persistence.GenerationType.IDENTITY;
import static javax.persistence.GenerationType.SEQUENCE;

import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Communication
 */
@Entity
@Table(name="Communication"
    ,schema="public"
)
public class Communication extends AbstractPO{

	
	private static final long serialVersionUID = 1L;
	
    private Long id;
    private CommunicationType communicationType;
    private String emailSubject;
    private String content;
    private Date deliveryTime;
    private String emailId;
    private String mobileNumber;
    private Short status;
    private String statusReason;
    private String createdBy;
    private Date createdOn;
    private String modifiedBy;
    private Date modifiedOn;
    private String rfu1;
    private String rfu2;
    private String rfu3;
    
    @SequenceGenerator(name="generator", sequenceName="communication_seq")@Id @GeneratedValue(strategy=SEQUENCE, generator="generator")
    
    @Column(name="CommunicationID", unique=true, nullable=false, precision=10, scale=0)
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	
	@ManyToOne(fetch=FetchType.EAGER)
    @JoinColumn(name="Communication_TypeID")
	public CommunicationType getCommunicationType() {
		return communicationType;
	}
	public void setCommunicationType(CommunicationType communicationType) {
		this.communicationType = communicationType;
	}
	
	@Column(name="Email_Subject", nullable=true, length=1000)
	public String getEmailSubject() {
		return emailSubject;
	}
	public void setEmailSubject(String emailSubject) {
		this.emailSubject = emailSubject;
	}
	
	@Column(name="Content", nullable=true, length=4000)
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	
	@Column(name="Delivery_Time", nullable=true, length=23)
	public Date getDeliveryTime() {
		return deliveryTime;
	}
	public void setDeliveryTime(Date deliveryTime) {
		this.deliveryTime = deliveryTime;
	}
	
	@Column(name="EmailID", nullable=true, length=100)
	public String getEmailId() {
		return emailId;
	}
	public void setEmailId(String emailId) {
		this.emailId = emailId;
	}
	
	@Column(name="Mobile_Number", nullable=true, length=14)
	public String getMobileNumber() {
		return mobileNumber;
	}
	public void setMobileNumber(String mobileNumber) {
		this.mobileNumber = mobileNumber;
	}
	
	@Column(name="Status", nullable=false, precision=4, scale=0)
	public Short getStatus() {
		return status;
	}
	public void setStatus(Short status) {
		this.status = status;
	}
	
	@Column(name="Status_Reason", length=2000)
	public String getStatusReason() {
		return statusReason;
	}
	public void setStatusReason(String statusReason) {
		this.statusReason = statusReason;
	}
	
	@Column(name="CreatedBy", nullable=false, length=50)
	public String getCreatedBy() {
		return createdBy;
	}
	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}
	
	@Column(name="CreatedOn", nullable=false, length=23)
	public Date getCreatedOn() {
		return createdOn;
	}
	public void setCreatedOn(Date createdOn) {
		this.createdOn = createdOn;
	}
	
	@Column(name="ModifiedBy", length=50)
	public String getModifiedBy() {
		return modifiedBy;
	}
	public void setModifiedBy(String modifiedBy) {
		this.modifiedBy = modifiedBy;
	}
	
	@Column(name="ModifiedOn", length=23)
	public Date getModifiedOn() {
		return modifiedOn;
	}
	public void setModifiedOn(Date modifiedOn) {
		this.modifiedOn = modifiedOn;
	}
	
	@Column(name="RFU1", length=100)
	public String getRfu1() {
		return rfu1;
	}
	public void setRfu1(String rfu1) {
		this.rfu1 = rfu1;
	}
	
	@Column(name="RFU2", length=100)
	public String getRfu2() {
		return rfu2;
	}
	public void setRfu2(String rfu2) {
		this.rfu2 = rfu2;
	}
	
	@Column(name="RFU3", length=100)
	public String getRfu3() {
		return rfu3;
	}
	public void setRfu3(String rfu3) {
		this.rfu3 = rfu3;
	}
}


